package app.agent.presentation

import im.mange.jetboot.bootstrap3.Bootstrap
import im.mange.jetboot.css.Classes
import im.mange.jetboot.{Css, Renderable, Html}
import app.agent.test.Lozenge
import Html._
import Css._
import Bootstrap._

case class StatusRenderer(triState: Option[Boolean], inProgress: Boolean) extends Renderable {
  def render = span().classes(classForState).styles(marginLeft("3px"), marginRight("5px")).render

  private def classForState = triState match {
    case Some(true) => Classes(glyphicon("ok"), "green")
    case Some(false) => Classes(glyphicon("remove"), "red")
    case None if inProgress => Classes(glyphicon("minus"), "amber")
    case None => Classes()
  }
}
